{#{% extends 'public/base.html' %}#}
{% extends 'index/index.html' %}
{% block hello %}
    {% import "public/fenye.html" as macros %}
    <div class="tpl-content-wrapper ">
        <div class="tpl-content-page-title"></div>
        <div class="tpl-portlet-components">
            <form action="{{ url_for('health.search') }}">
                <div class="navbar-form" style="text-align:center">
                    <div class="form-group">
                        <input type="text" name="q" class="form-control" placeholder="请输入身份证号码或者手机号"
                               style="width: 250px;">
                        <button type="submit" class="btn btn-default">查找</button>
                    </div>
                    {##}
                </div>
                <a href="{{ url_for('health.add_case') }}"><input type="button" name=""
                                                           class="am-btn am-btn-default am-btn-success" value="添加患者档案"></a>
                {#                <div style="margin-top: 10px">#}
                {#                    <a href="{{url_for('health.add_case')}}"><input type="button" name="" class="am-btn am-btn-default am-btn-success" value="添加"></a>#}
                {##}
                {#                </div>#}
                <div class="portlet-title">
                    <div class="caption font-green bold">
                    </div>
                </div>

                {% with messages = get_flashed_messages() %}
                    {% if messages %}
                        <ul class='flashes'>
                            {% for message in messages %}
                                <li style="color: #b92c28;">{{ message }}</li></ul>
                            {% endfor %}
                    {% endif %}
                {% endwith %}

                <!--{#                <form action="{{ url_for('search') }}">#}-->

                <table class="am-table am-table-striped am-table-hover table-main" style="width: 90%">
                    <thead>
                    <tr>
                        <th></th>
                        <th></th>
                        <th>用户id</th>
                        <th>用户手机号</th>
                        <th>姓名</th>
                        <th>身份证号</th>
                        <th>年龄</th>
                        <th></th>
                        <th>性别</th>
                        <th></th>
                        <th>体重</th>
                        <th>身高</th>
                        <th>备注</th>
                        <th>医顾</th>
                        <th>第三方id</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for row in index_list %}
                        <tr>
                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <a href="{{ url_for('health.editor',id=row.id) }}"><input type="button" value="编辑"
                                                                                           class="btn btn-primary"></a>
                                        <a href="{{ url_for('health.delete',id=row.id) }}"><input type="button" value="删除"
                                                                                           class="btn btn-danger"></a>
                                    </div>
                                </div>
                            </td>
                            {#                            <td><input type="checkbox"  name="name" value="{{row.id}}"></td>#}
                            <td><input type="hidden" name="name" value="{{ row.id }}"></td>
                            <td>{{ row.user_id }}</td>
                            <td>{{ row.mobile }}</td>
                            <td>{{ row.real_name }}</td>
                            <td>{{ row.id_card }}</td>
                            <td>{{ row.age }}</td>
                            {#                            <td >{{ row.sex}}</td>#}
                            <td>
                                {% if row.sex==1 %}
                                    <td>男</td>
                                {% elif row.sex==2 %}
                                    <td>女</td>
                                {% elif row.sex==0 %}
                                    <td>未知</td>
                                {% endif %}
                            <td>
                            <td>{{ row.weight }}</td>
                            <td>{{ row.height }}</td>
                            <td>{{ row.remark }}</td>
                            <td>{{ row.health_consultant.name}}</td>
                            <!--<td>-->
                                 <!--<select name='consultant'>-->
                                     <!--{%for work in consultants%}-->
                                     <!--<option value="{{work.id}}" {%if row.consultant_id == work.id%} selected {%endif%}>{{work.name}}</option>-->
                                    <!--{%endfor%}-->
                                <!--</select>-->
                            <!--</td>-->
                            <td>{{ row.outer_id }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
                <nav aria-label="Page navigation" class="pull-right">
                    <ul class="pagination">
                        {{ html|safe }}
                    </ul>
                </nav>
            </form>

        </div>
    </div>
{% endblock %}